import 'package:kmxy_base/util/amap_location_util.dart';
import 'package:kmxy_base_example/page/page_manage_package.dart';
import 'package:kmxy_base/base/base_package.dart';

abstract class LocationDataPageState extends BasePageState<LocationDataPage> {
  Map? locationResult;

  List dataList = [];

  @override
  initData() async {
    AMapLocationUtil.getInstance
        .initLocation('29d5ae3fd1b026b22c6f715ae0baa9fa', '');
    AMapLocationUtil.getInstance.setLatLngListener((locationData) {
      dataList.add({
        'locationCount': locationData['locationCount'],
        'latitude': locationData['latitude'],
        'longitude': locationData['longitude'],
      });
      setState(() {
        locationResult = locationData;
      });
    });
  }

  @override
  destroyData() {
    // AMapLocationUtil.getInstance.destroyLocation();
  }

  ///开始定位
  startLocation() {
    // AMapLocationUtil.getInstance.startLocation();
  }

  ///停止定位
  stopLocation() {
    // AMapLocationUtil.getInstance.stopLocation();
  }
}
